package com.bjsxt.mapper;

import com.bjsxt.pojo.AdminRole;
import com.bjsxt.pojo.Role;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface AdminRoleMapper {

    //添加
    @Insert("insert into t_admin_role values(#{param1},#{param2},default)")
    Integer insertAdminRole(Integer aid,Integer rid);

    //修改之前管理员回显
    @Select("SELECT ar.rid FROM t_role r JOIN t_admin_role ar on ar.rid=r.rid WHERE ar.aid=#{param1}")
    Integer selectAdminRoleOne(Integer aid);

    //修改
    @Update("update t_admin_role set rid=#{param1} where aid=#{param2}")
    Integer updateAdminRole(Integer rid,Integer aid);
}
